﻿using Common;

namespace TeamIce
{
	public class IcePlayer : IPosition
	{
		public IcePlayer(Player p) 
			: this(p.Position, p.Velocity, p.PlayerType, p.FallenTimer, p.TackleTimer)
		{
		}

		public IcePlayer(IcePlayer p)
			: this(p.Position, p.Velocity, p.PlayerType, p.FallenTimer, p.TackleTimer)
		{
		}

		public IcePlayer(Vector pos, Vector vel, PlayerType pt, int fallenTimer = 0, int tackleTimer = 0)
		{
			Position = pos;
			Velocity = vel;
			PlayerType = pt;
			FallenTimer = fallenTimer;
			TackleTimer = tackleTimer;
		}

		public Player GetClosest(Team team)
		{
			return Position.GetClosest(team);
		}

		public float GetDistanceTo(IPosition obj)
		{
			return Position.GetDistanceTo(obj);
		}

		public Vector Position { get; set; }
		public Vector Velocity { get; set; }
		public PlayerType PlayerType { get; private set; }
		public int FallenTimer { get; private set; }
		public int TackleTimer { get; private set; }
	}
}
